home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------
- //
- // Filename : top10.h
- // Description : Header file for top10 class
- // Author : Marnich van Rensburg (2002)
- //
- //----------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------
-
-
- #include <stdio.h>
-
- #ifndef TOP10_H
- #define TOP10_H
-
-
- //----------------------------------------------------------------------------------------
- // Structure for storing highscore details
- //----------------------------------------------------------------------------------------
- struct HighScore
- {
- char Name[25]; // Players Name
- unsigned int Score; // The player's score
- unsigned int Lines; // Total Line Count
- unsigned int Level; // The current level
-
- };// HighScore
-
- class Top10
- {
- public:
- Top10();
- void Init();
- bool IsNewHighScore(unsigned int Score);
- void SetEntry(char Name[25], unsigned int Score, unsigned int Lines, unsigned int Level);
- HighScore List[10]; // List of top 10 highscores
-
- private:
- HighScore t_Entry; // temp highscore entry
-
- void Encrypt(const char *TargetFile);
- void Save(); // Writes highscores to file
- bool Load(); // Reads highscores from file
- void Copy(HighScore& Source, HighScore& Dest); // Makes a copy of a highscore entry
-
- };// Top10
-
- #endif;